//-----------------------------------------------------------------------
// <copyright file="tblOpicsTransactionService.cs" company="Cyvee">
//     Copyright ? Cyvee. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using Scb.Framework;
using Robot.Entities;
using Robot.Data;

namespace Robot.Business
{
  /// <summary>
  /// 
  /// </summary> 
  public class tblOpicsTransactionService
  {
    #region My Storeprocedure


    public static tblOpicsTransactionCollection GettblOpicsTransactionListByStatus(int status)
    {
      try
      {
        tblOpicsTransactionDAO tblOpicsTransactionDAO = new tblOpicsTransactionDAO();
        return tblOpicsTransactionDAO.GettblOpicsTransactionListByStatus(status);
      }
      catch (BusinessException)
      {
        throw;
      }
      catch (Exception ex)
      {
        // log this exception
        Logger.Error(ex);
        // wrap it and rethrow
        throw new BusinessException(SR.BusinessGettblOpicsTransactionListException, ex);
      }
    }



    #endregion



    #region tblOpicsTransaction

    public static void CreatetblOpicsTransaction(tblOpicsTransaction tblOpicsTransaction)
    {
      try
      {
        tblOpicsTransactionDAO tblOpicsTransactionDAO = new tblOpicsTransactionDAO();
        tblOpicsTransactionDAO.CreatetblOpicsTransaction(tblOpicsTransaction);
      }
      catch (BusinessException)
      {
        throw;
      }
      catch (Exception ex)
      {
        // log this exception
        Logger.Error(ex);
        // wrap it and rethrow
        throw new BusinessException(SR.BusinessCreatetblOpicsTransactionException, ex);
      }
    }

    public static void UpdatetblOpicsTransaction(tblOpicsTransaction tblOpicsTransaction)
    {
      try
      {
        tblOpicsTransactionDAO tblOpicsTransactionDAO = new tblOpicsTransactionDAO();
        tblOpicsTransactionDAO.UpdatetblOpicsTransaction(tblOpicsTransaction);
      }
      catch (BusinessException)
      {
        throw;
      }
      catch (Exception ex)
      {
        // log this exception
        Logger.Error(ex);
        // wrap it and rethrow
        throw new BusinessException(SR.BusinessUpdatetblOpicsTransactionException, ex);
      }
    }

    public static void DeletetblOpicsTransaction(Guid id)
    {
      try
      {
        tblOpicsTransactionDAO tblOpicsTransactionDAO = new tblOpicsTransactionDAO();
        tblOpicsTransactionDAO.DeletetblOpicsTransaction(id);
      }
      catch (BusinessException)
      {
        throw;
      }
      catch (Exception ex)
      {
        // log this exception
        Logger.Error(ex);
        // wrap it and rethrow
        throw new BusinessException(SR.BusinessDeletetblOpicsTransactionException, ex);
      }
    }

    public static tblOpicsTransaction GettblOpicsTransaction(Guid id)
    {
      try
      {
        tblOpicsTransactionDAO tblOpicsTransactionDAO = new tblOpicsTransactionDAO();
        return tblOpicsTransactionDAO.GettblOpicsTransaction(id);
      }
      catch (BusinessException)
      {
        throw;
      }
      catch (Exception ex)
      {
        // log this exception
        Logger.Error(ex);
        // wrap it and rethrow
        throw new BusinessException(SR.BusinessGettblOpicsTransactionException, ex);
      }
    }

    public static tblOpicsTransactionCollection GettblOpicsTransactionList(tblOpicsTransactionColumns orderBy, OrderDirection orderDirection)
    {
      try
      {
        tblOpicsTransactionDAO tblOpicsTransactionDAO = new tblOpicsTransactionDAO();
        return tblOpicsTransactionDAO.GettblOpicsTransactionList(orderBy, orderDirection);
      }
      catch (BusinessException)
      {
        throw;
      }
      catch (Exception ex)
      {
        // log this exception
        Logger.Error(ex);
        // wrap it and rethrow
        throw new BusinessException(SR.BusinessGettblOpicsTransactionListException, ex);
      }
    }

    public static tblOpicsTransactionCollection GettblOpicsTransactionList(tblOpicsTransactionColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
    {
      try
      {
        tblOpicsTransactionDAO tblOpicsTransactionDAO = new tblOpicsTransactionDAO();
        return tblOpicsTransactionDAO.GettblOpicsTransactionList(orderBy, orderDirection, page, pageSize, out totalRecords);
      }
      catch (BusinessException)
      {
        throw;
      }
      catch (Exception ex)
      {
        // log this exception
        Logger.Error(ex);
        // wrap it and rethrow
        throw new BusinessException(SR.BusinessGettblOpicsTransactionListException, ex);
      }
    }

    #endregion
  }
}